#
# Copyright (C) 2015-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v3.
#
# Copyright (C) 2017 Hugo Yuan <429632952@163.com>
# Copyright (C) 2018 Hugo Yuan <hugolxq@gmail.com>

include $(TOPDIR)/rules.mk

PKG_NAME:=kcptun
PKG_VERSION:=18.03.16
PKG_RELEASE:=20180316

include $(INCLUDE_DIR)/package.mk

define Package/$(PKG_NAME)
	SECTION:=net
	CATEGORY:=Network
	TITLE:=A Fast & Secure Tunnel Based On KCP with N:M Multiplexing
	DEPENDS:=
	URL:=https://github.com/xtaci/kcptun
endef

define Package/$(PKG_NAME)/description
kcptun is a Fast & Secure Tunnel Based On KCP with N:M Multiplexing
endef

define Build/Prepare
endef

define Build/Configure
endef

define Build/Compile
endef

define Package/$(PKG_NAME)/install
	$(INSTALL_DIR) $(1)/usr/bin
ifeq ($(ARCH),mipsel)
	$(INSTALL_BIN) ./files/7620n/ssr-kcptun $(1)/usr/bin/
endif
ifeq ($(ARCH),mips)
	$(INSTALL_BIN) ./files/ar71xx/ssr-kcptun $(1)/usr/bin/
endif
ifeq ($(ARCH),i386)
	$(INSTALL_BIN) ./files/x86/ssr-kcptun $(1)/usr/bin/
endif
ifeq ($(ARCH),x86_64)
	$(INSTALL_BIN) ./files/x86_64/ssr-kcptun $(1)/usr/bin/
endif
ifeq ($(ARCH),arm)
	$(INSTALL_BIN) ./files/arm/ssr-kcptun $(1)/usr/bin/
endif
ifeq ($(ARCH),aarch64)
	$(INSTALL_BIN) ./files/armv7/ssr-kcptun $(1)/usr/bin/
endif
endef

$(eval $(call BuildPackage,$(PKG_NAME)))
